<template>
  <div class="home">
     <p>{{num}}</p>
     <p>{{price}}</p>
     <button @click="num++">++</button>
  </div>
</template>

<script>
// @ is an alias to /src
import { ref,computed } from 'vue';
export default {
  name: 'Home',
  components: {

  },

  setup(){
    const num = ref(10);
    // computed 计算属性他是一个方法
    const price = computed(() => num.value*100);
    return{
      num,
      price
    }
  }
}
</script>
